import request from '@/utils/request'

export const getArticles = params => request.get('/interview/query', { params })

export const getDetails = id => request.get('/interview/show', { params: { id } })

export const setUpLikes = id => request.post('/interview/opt', { id, optType: 1 })
export const setUpCollect = id => request.post('/interview/opt', { id, optType: 2 })

export const getLikes = (obj) => request.get('/interview/opt/list', { params: { optType: 1, pageSize: 10, page: obj.page } })

export const getCollect = (obj) => request.get('/interview/opt/list', {
  params: {
    page: obj.page,
    pageSize: 5,
    optType: 2
  }
})

export const getUserInfo = () => request('/user/currentUser')
